<template>
    <div id="logistics">
        <div class="logisticsInfo">
            <div class="two">
                <div class="cutDetail">
                    <ul class="photo">
                        <li><img :src="logisticsList.sku_thumb"></li>
                    </ul>
                    <ul class="cut-right">
                        <li class="one">物流公司：<span>{{logisticsList.company}}</span></li>
                        <li class="two">运单编号：<span>{{logisticsList.logisticsNum}}</span></li>
                        <li class="three">官方电话：<span>{{logisticsList.phone}}</span></li>
                    </ul>
                </div>
            </div>
        </div>
        <div class="logisticsList">
            <div class="logisticsList-header">
                <p>订单跟踪</p>
            </div>
            <div class="track-rcol">
                <div class="track-list">
                    <ul>
                        <li v-for="(x,y) in logisticsList.data" :class="y==0?'first':''">
                            <div>
                                <i class="node-icon"></i>
                                <p class="txt">{{x.context}}</p>
                                <p class="time">{{x.time}}</p>
                            </div>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
</template>

<script>
    import share from "../share/share.js";
    import config from "../config/config.js";
    export default {
        name: "logistics",
        data(){
            return{
                logisticsList:{}
            }
        },
        methods:{
            getLogisticsInfo(){

                var value=JSON.stringify({"orderid":this.$route.params.orderid,"bt_type":this.$route.params.btType,"token":localStorage.getItem('token')}),
                    key=demo(value);
                axios.post('/Home/order/OrderButtonListener',{
                    value:value,
                    key:key
                },config)
                    .then(function(response) {
                        if(response.data.code==200){
                            this.logisticsList=response.data.data;
                        }
                    }.bind(this))
                    .catch(function (error) {
                        console.log(error);
                    });
            }
        },
        activated(){
            this.getLogisticsInfo();
            share({})
        }
    }
</script>

<style scoped>

</style>